package com;

import java.io.IOException;

import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;


public class SDFSMultiServer {
	
    public static void main(String[] args) throws IOException {
    	SSLServerSocketFactory sslserversocketfactory =
            (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
    	SSLServerSocket sslserversocket = null;
        boolean listening = true;

        try {
            sslserversocket = (SSLServerSocket) sslserversocketfactory.createServerSocket(7785);
            sslserversocket.setNeedClientAuth(true);
        } catch (IOException e) {
            System.err.println("*****Could not listen on port.");
            System.exit(-1);
        }

        while (listening) {
        	System.out.println("*****Waiting for client connexion...");
        	new SDFSMultiServerThread((SSLSocket)sslserversocket.accept()).start();
        }

        sslserversocket.close();
    }
}
